package tang.common;

import java.nio.ByteBuffer;

/**
 * @author Tang
 * @classname Request
 * @description [  ]
 * @date 2021/2/23 20:51
 */
public class CreateRequest extends Record{

    /**
     * 操作类型
     */
    private String type;

    /**
     * 路径
     */
    private String path;

    public CreateRequest(String type, String path) {
        this.type = type;
        this.path = path;
    }

    @Override
    public void encoder() {
        byte[] type = this.type.getBytes();
        byte[] path = this.path.getBytes();;
        data.putInt(type.length);
        data.put(type);
        data.putInt(path.length);
        data.put(path);
        data.flip();
    }

    @Override
    public void decoder(ByteBuffer respData) {

    }
}